{{$min = $page - 2}}
{{if $min <= 0}}{{$min = 1}}{{/if}}
{{$max = $min + 5}}
{{if $max > ceil($count/$limit)}}{{$max = ceil($count/$limit) + 1}}{{/if}}
{{$queryString = ''}}
{{if $query|default}}
{{$query = ','|explode:$query}}
{{foreach $query as $v}}
{{if $_param.get.$v|default}}{{$queryString = $queryString|cat:'&amp;'|cat:$v|cat:'='|cat:$_param.get.$v}}{{/if}}
{{/foreach}}
{{/if}}
<section class="page">
<ul>
{{section name=sec start=$min loop=$max}}
<li>
{{if $smarty.section.sec.index == $page}}
<span>{{$smarty.section.sec.index}}</span>
{{else}}
<a href="{{$_param.page}}?p={{$smarty.section.sec.index}}{{$queryString}}">{{$smarty.section.sec.index}}</a>
{{/if}}
</li>
{{/section}}
</ul>
<div>全{{$count}}件（{{($count/$limit)|ceil}}ページ）</div>
</section>
